﻿<UserControl x:Class="Cyclops.MainApplication.Options.View.SoundsSettings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:my="clr-namespace:Cyclops.MainApplication.Options.Controls" 
             xmlns:ValueConverters="clr-namespace:Cyclops.MainApplication.Options.ValueConverters"
             xmlns:Localization="clr-namespace:Cyclops.MainApplication.Localization;assembly=Cyclops.MainApplication.Localization"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
    <UserControl.Resources>
        <ValueConverters:Invertor x:Key="invertor"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <my:NamedSeparator Grid.ColumnSpan="2" Text="{Binding Path=Settings.CommonGroup, Source={StaticResource ResourceWrapper}}" />

        <TextBlock Grid.Row="1" Text="{Binding Path=Settings.DisableAllSounds, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <CheckBox x:Name="disableSounds" IsChecked="{Binding Settings.DisableAllSounds, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" Style="{StaticResource valueStyle}" />

        <TextBlock Grid.Row="2" Text="{Binding Path=Settings.SoundOnIncomingPrivate, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <my:SoundSelector Grid.Row="2" Grid.Column="1" Margin="10,0,5,0" Text="{Binding Settings.SoundOnIncomingPrivate, Mode=TwoWay}" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=disableSounds, Converter={StaticResource invertor}}"/>

        <TextBlock Grid.Row="3" Text="{Binding Path=Settings.SoundOnIncomingPublic, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <my:SoundSelector Grid.Row="3" Grid.Column="2" Margin="10,0,5,0" Text="{Binding Settings.SoundOnIncomingPublic, Mode=TwoWay}" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=disableSounds, Converter={StaticResource invertor}}"/>

        <TextBlock Grid.Row="4" Text="{Binding Path=Settings.SoundOnUserJoin, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <my:SoundSelector Grid.Row="4" Grid.Column="3" Margin="10,0,5,0" Text="{Binding Settings.SoundOnUserJoin, Mode=TwoWay}" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=disableSounds, Converter={StaticResource invertor}}"/>

        <TextBlock Grid.Row="5" Text="{Binding Path=Settings.SoundOnUserLeave, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <my:SoundSelector Grid.Row="5" Grid.Column="4" Margin="10,0,5,0" Text="{Binding Settings.SoundOnUserLeave, Mode=TwoWay}" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=disableSounds, Converter={StaticResource invertor}}"/>

        <TextBlock Grid.Row="6" Text="{Binding Path=Settings.SoundOnSystemMessage, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <my:SoundSelector Grid.Row="6" Grid.Column="4" Margin="10,0,5,0" Text="{Binding Settings.SoundOnSystemMessage, Mode=TwoWay}" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=disableSounds, Converter={StaticResource invertor}}"/>

        <TextBlock Grid.Row="7" Text="{Binding Path=Settings.SoundOnStatusChange, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <my:SoundSelector Grid.Row="7" Grid.Column="4" Margin="10,0,5,0" Text="{Binding Settings.SoundOnStatusChange, Mode=TwoWay}" VerticalAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=disableSounds, Converter={StaticResource invertor}}"/>

        <TextBlock Grid.Row="8" Text="{Binding Path=Settings.SoundEvenIfActive, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <CheckBox IsChecked="{Binding Settings.SoundEvenIfActive, Mode=TwoWay}" Grid.Row="8" Grid.Column="1" Style="{StaticResource valueStyle}" />

    </Grid>
</UserControl>
